export function formatDateTimeForHMS(obj) {
  if (obj == null) {
    return null
  }
  const date = new Date(obj)
  const y = 1900 + date.getYear()
  const m = '0' + (date.getMonth() + 1)
  const d = '0' + date.getDate()
  const h = '0' + date.getHours()
  const mm = '0' + date.getMinutes()
  const s = date.getSeconds()
  return (
    y +
    '-' +
    m.substring(m.length - 2, m.length) +
    '-' +
    d.substring(d.length - 2, d.length) +
    ' ' +
    h.substring(h.length - 2, h.length) +
    ':' +
    mm.substring(mm.length - 2, mm.length)
  )
}
export function formatDateTimeForHMS2(obj) {
  if (obj == null) {
    return null
  }
  const date = new Date(obj)
  const Y = date.getFullYear() + '-'
  const M =
    (date.getMonth() + 1 < 10
      ? '0' + (date.getMonth() + 1)
      : date.getMonth() + 1) + '-'
  const D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate()) + ' '
  const strDate = Y + M + D
  return strDate
}
